package com.luo.bbs.front.webapi.controller;

import com.example.bbs.front.service.ISignService;
import com.luo.common.restful.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/sign")
public class SignController {
    @Autowired
    private ISignService signService;

    /**
     * 签到
     * @return
     */
    @GetMapping
    public JsonResult sign(){
        signService.sign();
        return JsonResult.ok();
    }

    /**
     * 查询是否已签到
     * @return
     */
    @GetMapping("/isSign")
    public JsonResult isSign(){
        boolean sign = signService.isSign();
        return JsonResult.ok(sign);
    }
}
